package com.xinzhi.service;

import com.xinzhi.entity.Result;

import javax.servlet.http.HttpServletRequest;

public interface CartService {
    /**
     * 添加商品
     * @param productId
     * @param
     * @param httpServletRequest
     * @return
     */
    Result addProduct(String productId, HttpServletRequest httpServletRequest);

    /**
     * 查看购物车
     * @param httpServletRequest
     * @return
     */
    Result checkCart(HttpServletRequest httpServletRequest);


    /**
     * 在购物车中添加商品
     * @param productId               商品id
     * @param httpServletRequest      用户请求
     * @return
     */
    Result plusProduct(String productId,HttpServletRequest httpServletRequest);

    /**
     * 在购物车中减去商品
     * @param productId                商品id
     * @param httpServletRequest       用户请求
     * @return
     */
    Result subtractProduct(String productId, HttpServletRequest httpServletRequest);


    /**
     * 删除购物车中的商品
     * @param productId
     * @param httpServletRequest
     * @return
     */
    Result deleteProduct(String productId, HttpServletRequest httpServletRequest);
}
